package com.xuecheng.content.agent;

import com.xuecheng.api.media.model.dto.MediaDTO;
import com.xuecheng.common.constant.XcFeignServiceNameList;
import com.xuecheng.common.domain.response.RestResponse;
import com.xuecheng.content.agent.sentinel.MediaApiAgentFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * 微服务远程调用接口
 */
@FeignClient(value =  XcFeignServiceNameList.XC_MEDIA_SERVICE,fallback = MediaApiAgentFallBack.class)
public interface MediaApiAgent {
    String MediaPrefix="/media/";   //媒资业务的根路径,在被调用者上看不到,因为在nacos中配置好了
    //todo 远程调用查询媒资信息
    @GetMapping(MediaPrefix+"l/media/{mediaId}")    //被远程调用业务方法上的路径
    RestResponse<MediaDTO> getMediaById4s(@PathVariable Long mediaId);
}
